package cn.thornbird.orgsync.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Data
public class AppUserData {

    private String id;

    private String employeeNo;

    private String name;

    private String avatar;

    /**
     * 性别: 0-未知, 1-男, 2-女, 3-其他
     */
    private Integer gender;

    private String mobile;

    private String email;

    private String telephone;

    private String title;

    private String leaderId;

    private String mainDepartmentId;

    private Map<String, DepartmentInfo> departments;

    public List<String> getDepartmentIds() {
        if (departments == null) {
            return new ArrayList<>();
        }
        return departments.keySet().stream().collect(Collectors.toList());
    }


    @Data
    public static class DepartmentInfo {

        private Long order;

        private Boolean leader;

    }

}
